home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1998-04-01 | 844 b | 48 lines |
- '
- ' Raw sample streching.
- '
- ' (c) K.Hill, Mar 1998
- '
- '
- '
-
- BANK=10
- ' bank=free bank number.
- SR=11000
- ' sr=sample rate, it's assuming a raw sample without parsing an iff8svx.
-
- A$=Fsel$("")
- Open In 1,A$
- SL=Lof(1)
- Close 1
- ' sl=sample length of first sample
- Reserve As Chip Data BANK,SL
- Bload A$,Start(BANK)
- Sam Raw 15,Start(BANK),SL,SR
-
- ' sl2=sample length of destination sample. To halve quality,
- ' make it half the sample length of the first one.
- SL2=SL/8
- 'SL2=10000
-
- Reserve As Chip Data BANK+1,SL2
-
- P1#=Start(BANK)
- P2=Start(BANK+1)
- IR#=SL/SL2
-
- For N=1 To SL2
- Poke P2,Peek(P1#)
- Inc P2
- P1#=P1#+IR#
- Next
-
- SR2#=SR/IR#
- Sam Raw 15,Start(BANK+1),SL2,SR2#
- Print "Original sample length=",SL
- Print "Original sample rate=",SR
- Print
- Print "New sample length=",SL2
- Print "New sample rate=",Int(SR2#)
-
- 'Save Fsel$("newsample"),BANK+1